package main.java.cn.wolfcode.service.impl;

import cn.wolfcode.domain.Question;
import cn.wolfcode.domain.QuestionItem;
import cn.wolfcode.mapper.QuestionMapper;
import cn.wolfcode.qo.QueryObject;
import cn.wolfcode.service.IQuestionService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuquan
 * @program: car-business
 * @description:
 * @date 2021-01-21 15:07:19
 */
@Service
public class QuestionServiceImpl implements IQuestionService {
    @Autowired
    private QuestionMapper questionMapper;
    @Override
    public void save(Question question) {
        questionMapper.insert(question);

    }

    @Override
    public void delete(Long id) {

    }

    @Override
    public void update(Question question) {

    }

    @Override
    public Question get(Long id) {
        return questionMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Question> listAll() {
        return questionMapper.selectAll();
    }

    @Override
    public PageInfo<Question> query(QueryObject qo) {
        return null;
    }

    @Override
    public List<QuestionItem> selectQuestionItemByQuestionId(Long id) {
        return questionMapper.selectQuestionItemByQuestionId(id);
    }

    @Override
    public List<Integer> selectQuesionIdByType(Integer type) {
        return questionMapper.selectQuesionIdByType(type);
    }
}
